<template>
  <!-- 用户卡片 -->
  <div class="userInfo">
    <div class="userCard">
      <!-- 头像 -->
      <div class="userImg">
        <img :src="user.userImg || user.userImg" alt="" />
      </div>
      <!-- 信息 -->
      <div class="userName">
        <p class="userName1">{{ user.username }}</p>
        <p class="userName2">用户名：{{ user.username }}</p>
        <p class="userName3">{{ user.phone }}</p>
      </div>
      <!-- 管理 -->
      <div class="userMag">
        <van-icon name="setting" color="rgba(76,0,0,.7)" size="14px" />
        <span @click="$router.push('/userMag')">账号管理</span>
      </div>
    </div>
  </div>
</template>

<script>
export default {
  data() {
    return {
      imgUrl: "",
    };
  },
  props: ["user"],
};
</script>

<style lang="scss" scoped>
.userInfo {
  width: 100%;
  height: 149px;
  padding: 11px 12px;
  box-sizing: border-box;

  // 用户卡片
  .userCard {
    position: relative;
    display: flex;
    width: 100%;
    height: 100%;
    padding: 27px 16px;
    border-radius: 10px;
    box-sizing: border-box;
    background: linear-gradient(90deg, #eb3c3c, #ff7459);

    // 头像
    .userImg {
      width: 66px;
      height: 66px;
      border-radius: 50%;
      background-color: #ccc;
      overflow: hidden;
      img {
        width: 100%;
        height: 100%;
      }
    }

    // 信息
    .userName {
      margin-left: 11px;
      text-align: left;
      line-height: 22px;

      .userName1 {
        font-size: 15px;
        font-weight: 550;
        color: #fff;
      }

      .userName2 {
        font-size: 14px;
        color: #ffffffb3;
      }

      .userName3 {
        font-size: 15px;
        color: #ffffff;
        font-weight: 550;
      }
    }

    // 管理
    .userMag {
      position: absolute;
      right: 20px;
      top: 26px;
      line-height: 19px;
      height: 19px;
      span {
        font-size: 14px;
        color: #4c0000b3;
        padding-left: 5px;
      }
    }
  }
}
</style>
